package com.example.myapplication;

import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;

public class MainActivity extends AppCompatActivity {

    private BottomBarTab mTab;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ImageView iv_1 = (ImageView) findViewById(R.id.iv_1);
        ImageView iv_2 = (ImageView) findViewById(R.id.iv_2);
        iv_1.setBackgroundResource(R.drawable.ic_news);
        iv_1.setColorFilter(ContextCompat.getColor(this, R.color.colorPrimary));

        mTab = new BottomBarTab(this, R.drawable.ic_news,"尿频");
        LinearLayout linearLayout = (LinearLayout) findViewById(R.id.ll);
        RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
                RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
        linearLayout.addView(mTab,params);

        mTab.setSelected(true);
    }

}
